<html>
<head><meta charset="utf-8"><title>Drop with parameters · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html">Drop with parameters</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240026640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Drop%20with%20parameters/near/240026640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html#240026640">(May 24 2021 at 09:26)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="219696">@XAMPPRocky</span> (or others), I've a question. I'm thinking about how <code>Drop</code> takes no parameters and about the idea of a lint for specifying "custom close" functions that <em>ought</em> to be used. Do you know if any of your async drop close methods take parameters?</p>



<a name="240026656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Drop%20with%20parameters/near/240026656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html#240026656">(May 24 2021 at 09:26)</a>:</h4>
<p>(this seems independent of async or not)</p>



<a name="240026721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Drop%20with%20parameters/near/240026721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alice Ryhl <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html#240026721">(May 24 2021 at 09:27)</a>:</h4>
<p>I mean, async drop would need to take the context as a parameter</p>



<a name="240792626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Drop%20with%20parameters/near/240792626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html#240792626">(May 31 2021 at 05:06)</a>:</h4>
<p>I have not wanted custom parameters, but some way of requiring users to call a particular method that takes Self and destructs it instead of relying on Drop is something I’ve wanted</p>



<a name="240792634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Drop%20with%20parameters/near/240792634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html#240792634">(May 31 2021 at 05:06)</a>:</h4>
<p>I even thought at some point that implementing ManuallyDrop would do that</p>



<a name="240792690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Drop%20with%20parameters/near/240792690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html#240792690">(May 31 2021 at 05:08)</a>:</h4>
<p><a href="https://github.com/quinn-rs/quinn/blob/main/quinn-proto/src/connection/streams/recv.rs#L289">https://github.com/quinn-rs/quinn/blob/main/quinn-proto/src/connection/streams/recv.rs#L289</a></p>



<a name="241300627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Drop%20with%20parameters/near/241300627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html#241300627">(Jun 02 2021 at 18:33)</a>:</h4>
<p><span class="user-mention silent" data-user-id="226095">Dirkjan Ochtman</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters/near/240792626">said</a>:</p>
<blockquote>
<p>I have not wanted custom parameters, but some way of requiring users to call a particular method that takes Self and destructs it instead of relying on Drop is something I’ve wanted</p>
</blockquote>
<p>why did you want that, if not to pass additional parameters, <span class="user-mention" data-user-id="226095">@Dirkjan Ochtman</span> ?</p>



<a name="241300660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Drop%20with%20parameters/near/241300660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html#241300660">(Jun 02 2021 at 18:33)</a>:</h4>
<p>I guess another reason might be to "convert" the object into a new state</p>



<a name="241300675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Drop%20with%20parameters/near/241300675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html#241300675">(Jun 02 2021 at 18:33)</a>:</h4>
<p>i.e., to return a value</p>



<a name="241300685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Drop%20with%20parameters/near/241300685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html#241300685">(Jun 02 2021 at 18:33)</a>:</h4>
<p>that seems to be your example</p>



<a name="241302305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Drop%20with%20parameters/near/241302305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Drop.20with.20parameters.html#241302305">(Jun 02 2021 at 18:46)</a>:</h4>
<p>ok</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>